package cn.iocoder.yudao.module.peizhen.dal.mysql.hospital;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.peizhen.dal.dataobject.hospital.SectionDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 医院科室 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface SectionMapper extends BaseMapperX<SectionDO> {

    default PageResult<SectionDO> selectPage(PageParam reqVO, Integer hospitalId) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SectionDO>()
            .eq(SectionDO::getHospitalId, hospitalId)
            .orderByDesc(SectionDO::getId));
    }

    default int deleteByHospitalId(Integer hospitalId) {
        return delete(SectionDO::getHospitalId, hospitalId);
    }

}
